<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>wbc8</title>
    <style>
        .test {
            color: red;
            font-size:30px;
        }

    </style>
</head>
<body>

    <form action="">
        用户：<input type="text" name="user">
        密码；<input type="text" name="pawd">
    </form>

    <div id="myDiv" class="test">
        hello world
    </div>
    <span class="test">my span</span>


    <script>
        var myDiv = document.getElementById('myDiv');
        myDiv.style.color = "blue";
        myDiv.style.fontSize = "50px";
        myDiv.style.backgroundColor = 'pink';
        // myDiv.title = "123";
       // myDiv.className += ' test2';
       // myDiv.innerHTML = '<h1>李红聪</h1>';
       // myDiv.innerText = '<h1>李红聪</h1>';

        // document.write('<h1>李红聪</h1>')

        // var myDiv = document.getElementById('myDiv');

        // var span = document.getElementsByTagName('span');

        // var user = document.getElementsByName('user');
        // var test = document.getElementsByClassName('test');

       // console.log(test);

    </script>
</body>
</html>